<template>
	<b-layout-index>

		<theme-color-bg classs="test c4" type="c4">
			<navbar :isStyle="light"  :title="$t('冠军中心')"></navbar>
			<view class="withbtn ">
				<u-subsection bgColor="#14313f" activeColor="#14313f" inactiveColor="#ffffff" @change="sectionChange" :list="listcurt" :current="curNow"></u-subsection>
				
			</view>
			<view class="heder  pd-bottom-50 ">
				
				
				<view class="flex">
					<view class="hitem">
						<view class="hiimg">
							<view class="index cit2">2</view>
							<u-avatar size="80" :src="datalist[1].avatar"></u-avatar>

						</view>
					</view>
					<view class="hitema">

						<view class="hiimgc">
							<image class="king" src="../../../static/image/king.png"></image>
							<view class="index cit1">1</view>
							<u-avatar size="100" :src="datalist[0].avatar"></u-avatar>

						</view>
					</view>
					<view class="hitem">
						<view class="hiimg">
							<view class="index cit3">3</view>
							<u-avatar size="80" :src="datalist[2].avatar"></u-avatar>
						</view>
					</view>
				</view>
			</view>
		</theme-color-bg>
		<view class="body">

			<view class="pd-10 ">
				<block v-for="(item,index) in datalist">
					<view class="bgwhite mg-bottom-10 br-rd-10 hbitem" :class="cssl.indexOf(index)?cssl[index]:'citem'">
						<u-cell label="xxxx">

							<view slot="icon" class="flex">
								<view class="index ">{{index+1}}</view>
								<u-avatar size="50" :src="item.avatar"></u-avatar>

							</view>
							<view class="pd-left-5 pd-right-5 title  font-size-14" slot="title">{{item.name}}</view>
							<view class="pd-left-5 pd-right-5 remark font-size-12" slot="label"></view>
							<view class="pd-left-5 pd-right-5 remark font-size-14 priceA" slot="value">{{item.price}}</view>
						</u-cell>
					</view>
				</block>
			</view>




		</view>

	</b-layout-index>
</template>

<script>
	import {
		findByLevelLogList
	} from "@/api/userWallet.js"
	export default {
		data() {
			return {
				src: 'https://cdn.uviewui.com/uview/album/2.jpg',
				cssl: ["cit1", "cit2", "cit3"],
				datalist:[],
				  listcurt: ['ھەپتىلىك', 'ئايلىق'],
				  curNow:0
			}
		},
		onLoad: function() {
			this.getData(0)
		},
		methods: {
			getItemStyle: function(e) {
				var clsssss = "citem";
				switch (e) {
					case 0:
						clsssss = "cit1"
						break;
					case 1:
						clsssss = "cit2"
						break;
					case 2:
						clsssss = "cit3"
						break;

				}
				return clsssss
			},
			getData: function(index) {
				var the=this
				findByLevelLogList(index).then(res => {
					console.log(res)
					the.datalist=res;
				})
			},
				sectionChange(index) {
							this.curNow = index;
								this.getData(index)
						}
		}
	}
</script>

<style lang="scss">
	.bgwhite {
		background-color: #ffffff;
	}

	.font-size-12 {
		font-size: 12px;
	}

	.font-size-14 {
		font-size: 14px;
	}

	.hbitem {
		.index {
			padding-left: 5px !important;
			padding-right: 5px !important;
			font-size: 16px;
		}
	}

	.mg-bottom-10 {
		margin-bottom: 10px;
	}

	.br-rd-10 {
		border-radius: 10px;
	}

	.pd-10 {
		padding: 10px;
	}

	.priceA::after {
		content: "￥";
	}

	.flex {

		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	.hitem {
		width: 100%;
		text-align: center;
		border-radius: 100%;

	}

	.hitema {

		text-align: center;


	}

	.hiimg {
		width: 80px;

		margin: 0 auto;
		background-color: #7e9c52 !important;
		border-radius: 100%;
		border: 4px solid;
		text-align: center;
		align-items: center;


		.index {
			border: 2px #14313f solid;
			width: 30px;
			height: 30px;
			background-color: #44d7b6;
			font-size: 14px;
			align-items: center;

			line-height: 35px;
			border-radius: 100%;

			z-index: 10;
			margin: 0 auto;
			position: absolute;
			margin-top: 60px;
			margin-left: 20px;
			margin-right: 20px;

		}
	}

	.hiimgc {

		width: 100px;

		margin: 0 auto;
		background-color: #7e9c52 !important;
		border-radius: 100%;
		border: 4px solid;
		text-align: center;
		align-items: center;


		.king {
			width: 30px;
			height: 30px;

			margin-top: -30px;
			align-items: center;
			position: absolute;
			margin-left: -15px;
			margin-right: -15px;
		}

		.index {
			border: 2px #14313f solid;
			width: 30px;
			height: 30px;
			background-color: #44d7b6;
			font-size: 14px;
			align-items: center;

			line-height: 35px;
			border-radius: 100%;

			z-index: 10;
			margin: 0 auto;
			position: absolute;
			margin-top: 80px;
			margin-left: 30px;
			margin-right: 30px;

		}
	}

	.heder {
		margin-top: 50px !important;
		padding-bottom: 100px !important;
		overflow: hidden;

	}

	.test {
		border-bottom-left-radius: 30%;
		border-bottom-right-radius: 30%;
	}

	.body {
		margin-top: -70px;
	}

	.cit1 {
		background-color: #f2a304 !important;
		color: #fff !important;

		.index {
			color: #fff !important;
		}

		.title {
			color: #fff !important;
		}

		.remark {
			color: #fff !important;
		}

		.price {
			color: #fff !important;
		}
	}

	.cit2 {
		background-color: #7e9c52 !important;
		color: #fff !important;

		.index {
			color: #fff !important;
		}

		.title {
			color: #fff !important;
		}

		.remark {
			color: #fff !important;
		}

		.price {
			color: #fff !important;
		}
	}

	.cit3 {
		background-color: #44d7b6 !important;
		color: #fff !important;

		.index {
			color: #fff !important;
		}

		.title {
			color: #fff !important;
		}

		.remark {
			color: #fff !important;
		}

		.price {
			color: #fff !important;
		}
	}
	.c4{
		background-color: #14313f;
		color: #ffffff;
		background-image: url("../../../static/image/bg.png");
		background-size: 264px;
		background-position-x: center;
		background-repeat: no-repeat;
	}
	.withbtn{
		width: 80%;
		overflow: hidden;
		margin: 0 auto;
		direction: ltr;
	}
</style>
